<template>
  <div class="fenpei">
    <div class="fenpeis">
      <div>
        <el-input
          placeholder="搜索"
          v-model="com_name"
          class="input-with-select"
          style="width: 300px"
        >
          <el-button
            slot="append"
            icon="el-icon-search"
            @click="user_split_list"
          ></el-button>
        </el-input>
      </div>
      <div>
        <el-select
          v-model="type_id"
          placeholder="请选择类型"
          @change="user_split_list"
        >
          <el-option
            v-for="item in options"
            :key="item.id"
            :label="item.com_type"
            :value="item.id"
          >
          </el-option>
        </el-select>
      </div>
      <div>
        <el-select
          v-model="com_id"
          placeholder="请选择企业"
          @change="user_split_list"
        >
          <el-option
            v-for="item in option"
            :key="item.id"
            :label="item.com_name"
            :value="item.id"
          >
          </el-option>
        </el-select>
      </div>
      <div>
        <el-select
          v-model="award_id"
          placeholder="请选择奖项"
          @change="user_split_lists"
        >
          <el-option
            v-for="item in options1"
            :key="item.id"
            :label="item.award_name"
            :value="item.id"
          >
          </el-option>
        </el-select>
      </div>
      <div v-if="award_id == 7">
        <el-select
          v-model="fz_id"
          placeholder="请选择分组"
          @change="user_split_list"
        >
          <el-option
            v-for="item in fz"
            :key="item.id"
            :label="item.name"
            :value="item.id"
          >
          </el-option>
        </el-select>
      </div>
      <el-button type="primary" @click="daochus">
        导出
        <i class="el-icon-plus el-icon--right"></i>
      </el-button>
      <el-button type="primary" @click="daoru">
        导入
        <i class="el-icon-plus el-icon--right"></i>
      </el-button>
      <!-- <div>
        <el-select
          v-model="type_id"
          placeholder="请选择是否获奖"
          @change="user_split_list"
        >
          <el-option
            v-for="item in options"
            :key="item.id"
            :label="item.com_type"
            :value="item.id"
          >
          </el-option>
        </el-select>
      </div> -->
    </div>
    <div class="tables" v-if="award_id == 2">
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        :key="award_id"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="index" label="序号">
          <template scope="scope">
            <span>{{ (page - 1) * 15 + scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="award_name" label="奖项名称"> </el-table-column>
        <el-table-column prop="com_name" label="单位名称"> </el-table-column>
        <el-table-column prop="review_name" label="评审专家姓名">
          <template slot-scope="scope">
            <!-- <el-button
              type="primary"
              size="mini"
              icon="el-icon-edit"
              @click="defen(scope.row)"
              v-if="!scope.row.branch"
              >评审明细</el-button
            > -->
            <div
              v-for="(ITEM, INDEX) in scope.row.review_data"
              :key="INDEX"
              @click="defen(scope.row, ITEM)"
            >
              {{ ITEM.review_name }},分数{{ ITEM.score }}
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="score" label="平均分"> </el-table-column>
        <el-table-column label="获奖">
          <template scope="scope">
            <el-select
              v-model="scope.row.is_award"
              placeholder="是否获奖"
              style="width: 90px"
              @change="dafen(scope.row)"
            >
              <el-option
                v-for="item in jiang"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </template>
        </el-table-column>
        <!-- <el-table-column label="操作" width="250px">
          <template slot-scope="scope">
   
            <el-dropdown>
              <span class="el-dropdown-link">
                评审明细<i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item
                  v-for="(ITEM, INDEX) in scope.row.review_data"
                  :key="INDEX"
                  @click.native="defen(scope.row, ITEM)"
                  >{{ ITEM.review_name }}</el-dropdown-item
                >
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column> -->
      </el-table>
    </div>
    <div class="tables" v-if="award_id == 3">
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        :key="award_id"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="index" label="序号">
          <template scope="scope">
            <span>{{ (page - 1) * 15 + scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="award_name" label="奖项名称"> </el-table-column>
        <el-table-column prop="user_name" label="姓名"> </el-table-column>

        <el-table-column prop="com_name" label="单位" />
        <el-table-column prop="job" label="职务" />
        <el-table-column prop="review_name" label="评审专家姓名">
          <template scope="scope">
            <div
              v-for="(ITEM, INDEX) in scope.row.review_data"
              :key="INDEX"
              @click="defen(scope.row, ITEM)"
            >
              {{ ITEM.review_name }},分数{{ ITEM.score }}
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="score" label="平均分"> </el-table-column>
        <el-table-column label="获奖">
          <template scope="scope">
            <el-select
              v-model="scope.row.is_award"
              placeholder="是否获奖"
              style="width: 90px"
              @change="dafen(scope.row)"
            >
              <el-option
                v-for="item in jiang"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </template>
        </el-table-column>
        <!-- <el-table-column label="操作" width="250px">
          <template slot-scope="scope">
            <el-dropdown>
              <span class="el-dropdown-link">
                评审明细<i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item
                  v-for="(ITEM, INDEX) in scope.row.review_data"
                  :key="INDEX"
                  @click.native="defen(scope.row, ITEM)"
                  >{{ ITEM.review_name }}</el-dropdown-item
                >
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column> -->
      </el-table>
    </div>
    <div class="tables" v-if="award_id == 4">
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        :key="award_id"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="index" label="序号">
          <template scope="scope">
            <span>{{ (page - 1) * 15 + scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="award_name" label="奖项名称"> </el-table-column>

        <el-table-column prop="com_name" label="单位名称"> </el-table-column>

        <el-table-column prop="review_name" label="评审专家姓名">
          <template scope="scope">
            <div
              v-for="(ITEM, INDEX) in scope.row.review_data"
              :key="INDEX"
              @click="defen(scope.row, ITEM)"
            >
              {{ ITEM.review_name }},分数{{ ITEM.score }}
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="score" label="平均分"> </el-table-column>
        <el-table-column label="获奖">
          <template scope="scope">
            <el-select
              v-model="scope.row.is_award"
              placeholder="是否获奖"
              style="width: 90px"
              @change="dafen(scope.row)"
            >
              <el-option
                v-for="item in jiang"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </template>
        </el-table-column>
        <!-- <el-table-column label="操作" width="250px">
          <template slot-scope="scope">
            <el-dropdown>
              <span class="el-dropdown-link">
                评审明细<i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item
                  v-for="(ITEM, INDEX) in scope.row.review_data"
                  :key="INDEX"
                  @click.native="defen(scope.row, ITEM)"
                  >{{ ITEM.review_name }}</el-dropdown-item
                >
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column> -->
      </el-table>
    </div>
    <div class="tables" v-if="award_id == 5">
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        :key="award_id"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="index" label="序号">
          <template scope="scope">
            <span>{{ (page - 1) * 15 + scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="award_name" label="奖项名称"> </el-table-column>
        <el-table-column prop="user_name" label="姓名"> </el-table-column>

        <el-table-column prop="com_name" label="单位"> </el-table-column>
        <el-table-column prop="job" label="职务"> </el-table-column>
        <el-table-column prop="review_name" label="评审专家姓名">
          <template scope="scope">
            <div
              v-for="(ITEM, INDEX) in scope.row.review_data"
              :key="INDEX"
              @click="defen(scope.row, ITEM)"
            >
              {{ ITEM.review_name }},分数{{ ITEM.score }}
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="score" label="平均分"> </el-table-column>
        <el-table-column label="获奖">
          <template scope="scope">
            <el-select
              v-model="scope.row.is_award"
              placeholder="是否获奖"
              style="width: 90px"
              @change="dafen(scope.row)"
            >
              <el-option
                v-for="item in jiang"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </template>
        </el-table-column>
        <!-- <el-table-column label="操作" width="250px">
          <template slot-scope="scope">
            <el-dropdown>
              <span class="el-dropdown-link">
                评审明细<i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item
                  v-for="(ITEM, INDEX) in scope.row.review_data"
                  :key="INDEX"
                  @click.native="defen(scope.row, ITEM)"
                  >{{ ITEM.review_name }}</el-dropdown-item
                >
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column> -->
      </el-table>
    </div>
    <div class="tables" v-if="award_id == 6">
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        :key="award_id"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="index" label="序号">
          <template scope="scope">
            <span>{{ (page - 1) * 15 + scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="award_name" label="奖项名称"> </el-table-column>
        <el-table-column prop="user_name" label="姓名"> </el-table-column>

        <el-table-column prop="com_name" label="单位"> </el-table-column>
        <el-table-column prop="specialty" label="技术工种"> </el-table-column>
        <el-table-column prop="review_name" label="评审专家姓名">
          <template scope="scope">
            <div
              v-for="(ITEM, INDEX) in scope.row.review_data"
              :key="INDEX"
              @click="defen(scope.row, ITEM)"
            >
              {{ ITEM.review_name }},分数{{ ITEM.score }}
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="score" label="平均分"> </el-table-column>
        <el-table-column label="获奖">
          <template scope="scope">
            <el-select
              v-model="scope.row.is_award"
              placeholder="是否获奖"
              style="width: 90px"
              @change="dafen(scope.row)"
            >
              <el-option
                v-for="item in jiang"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </template>
        </el-table-column>
        <!-- <el-table-column label="操作" width="250px">
          <template slot-scope="scope">
            <el-dropdown>
              <span class="el-dropdown-link">
                评审明细<i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item
                  v-for="(ITEM, INDEX) in scope.row.review_data"
                  :key="INDEX"
                  @click.native="defen(scope.row, ITEM)"
                  >{{ ITEM.review_name }}</el-dropdown-item
                >
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column> -->
      </el-table>
    </div>
    <div class="tables" v-if="award_id == 7">
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        :key="award_id"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="index" label="序号">
          <template scope="scope">
            <span>{{ (page - 1) * 15 + scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="award_name" label="奖项名称"> </el-table-column>
        <el-table-column prop="project_name" label="项目名称"></el-table-column>
        <el-table-column prop="com_name" label="申报单位"> </el-table-column>
        <el-table-column prop="domain" label="行业"> </el-table-column>
        <el-table-column prop="zf_name" label="分组"></el-table-column>
        <el-table-column prop="review_name" label="评审专家姓名">
          <template scope="scope">
            <div
              v-for="(ITEM, INDEX) in scope.row.review_data"
              :key="INDEX"
              @click="defen(scope.row, ITEM)"
            >
              {{ ITEM.review_name }},分数{{ ITEM.score }}
            </div>
          </template></el-table-column
        >
        <el-table-column prop="score" label="平均分"> </el-table-column>

        <el-table-column label="获奖">
          <template slot-scope="scope">
            <el-select
              v-model="scope.row.is_award_details"
              placeholder="获奖等级"
              style="width: 90px"
              @change="dafen(scope.row)"
            >
              <el-option
                v-for="item in jiangs"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </template>
        </el-table-column>
        <!-- <el-table-column label="操作" width="100px">
          <template slot-scope="scope">
            <el-dropdown>
              <span class="el-dropdown-link">
                评审明细<i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item
                  v-for="(ITEM, INDEX) in scope.row.review_data"
                  :key="INDEX"
                  @click.native="defen(scope.row, ITEM)"
                  >{{ ITEM.review_name }}</el-dropdown-item
                >
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column> -->
      </el-table>
    </div>
    <div class="fenye">
      <el-pagination
        layout="prev, pager, next"
        :total="num_page"
        @current-change="handleCurrentChange"
      >
      </el-pagination>
    </div>
    <el-dialog
      title="评分"
      :visible.sync="centerDialogVisibles"
      width="1400px"
      center
    >
      <div v-if="obj_id == 1"></div>
      <div v-else-if="obj_id == 2">
        <innovation2 :objs="objs" v-if="centerDialogVisibles"></innovation2>
      </div>
      <div v-else-if="obj_id == 3">
        <present2 :objs="objs" v-if="centerDialogVisibles"></present2>
      </div>
      <div v-else-if="obj_id == 4">
        <Promotion2 :objs="objs" v-if="centerDialogVisibles"></Promotion2>
      </div>
      <div v-else-if="obj_id == 5">
        <Promotions2 :objs="objs" v-if="centerDialogVisibles"></Promotions2>
      </div>
      <div v-else-if="obj_id == 6">
        <craftsman2 :objs="objs" v-if="centerDialogVisibles"></craftsman2>
      </div>
      <div v-else-if="obj_id == 7">
        <achievement2 :objs="objs" v-if="centerDialogVisibles"></achievement2>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="centerDialogVisibles = false">取 消</el-button>
        <el-button type="primary" @click="centerDialogVisibles = false"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
let inputElement = null;
import innovation1 from "../components/innovation1.vue";
import present1 from "../components/present1.vue";
import Promotion1 from "../components/Promotion1.vue";
import Promotions1 from "../components/Promotions1.vue";
import craftsman1 from "../components/craftsman1.vue";
import achievement1 from "../components/achievement1.vue";
import innovation2 from "../components/innovation2.vue";
import present2 from "../components/present2.vue";
import Promotion2 from "../components/Promotion2.vue";
import Promotions2 from "../components/Promotions2.vue";
import craftsman2 from "../components/craftsman2.vue";
import achievement2 from "../components/achievement2.vue";
import {
  create_user_review,
  typeApi,
  user_select,
  award_find,
  review_award_list,
  user_child_details,
  is_award,
  fz_select,
  importS,
} from "../axios/api";
export default {
  data() {
    return {
      com_name: "",
      centerDialogVisible: false,
      award_id: "",
      num_page: 0,
      com_id: "",
      id: this.$route.query.id,
      page: 1,
      type_id: "",
      tableData: [],
      obj_id: "",
      tableDatas: [],
      multipleSelection: [],
      options: [],
      option: [],
      jiang: [
        { name: "是", id: 1 },
        { name: "否", id: 2 },
      ],
      jiangs: [
        { name: "一等奖", id: 1 },
        { name: "二等奖", id: 2 },
        { name: "优秀奖", id: 3 },
        { name: "未获奖", id: 4 },
      ],
      options1: [],
      options2: [],
      objs: {},
      fz_id: "",
      fz: [],
      centerDialogVisibles: false,
    };
  },
  created() {
    this.typeApi();
    this.user_select();
    this.award_find();
    this.fz_select();
  },
  components: {
    innovation1,
    present1,
    Promotion1,
    Promotions1,
    craftsman1,
    achievement1,

    innovation2,
    present2,
    Promotion2,
    Promotions2,
    craftsman2,
    achievement2,
  },

  methods: {
    user_split_lists() {
      this.fz_id = "";
      this.user_split_list();
    },
    fz_select() {
      fz_select().then((res) => {
        this.fz = res.data.data;
      });
    },
    dafen(e) {
      console.log(e);
      if (this.award_id != 7) {
        let params = {
          is_award: e.is_award,
          id: e.id,
          token: sessionStorage.getItem("Token1"),
        };
        is_award(params).then((res) => {
          if (res.data.code == 200) {
            this.$message({
              message: "评审成功",
              type: "success",
            });

            this.user_split_list();
          } else {
            this.$message({
              message: res.data.msg,
            });
          }
        });
      } else {
        var is_awards = 2;
        if (e.is_award_details != 4) {
          is_awards = 1;
        }
        let params = {
          is_award: is_awards,
          id: e.id,
          token: sessionStorage.getItem("Token1"),
          is_award_details: e.is_award_details == 4 ? "" : e.is_award_details,
        };
        is_award(params).then((res) => {
          if (res.data.code == 200) {
            this.$message({
              message: "评审成功",
              type: "success",
            });

            this.user_split_list();
          } else {
            this.$message({
              message: res.data.msg,
            });
          }
        });
      }
    },
    daoru() {
      // 生成文件上传的控件
      inputElement = document.createElement("input");
      inputElement.setAttribute("type", "file");
      inputElement.style.display = "none";

      if (window.addEventListener) {
        inputElement.addEventListener("change", this.uploadFile1, false);
      } else {
        inputElement.attachEvent("onchange", this.uploadFile1);
      }

      document.body.appendChild(inputElement);

      inputElement.click();
    },
    uploadFile1(el) {
      console.log(el.target.files[0]);
      // console.log(file,'文件');
      let file = el.target.files[0];

      let extension = file.name.split(".");
      let extension2 = file.name.split(".");
      let extensions = extension[extension.length - 1] === "xls";
      let extension2s = extension2[extension.length - 1] === "xlsx";

      if (!extensions && !extension2s) {
        this.$message.warning("上传模板只能是 xls、xlsx格式!");
        return;
      }
      const form = new FormData();
      form.append("file", file);
      importS(form).then((res) => {
        console.log(res);
        if (res.data.code == 200) {
          this.$message.success({
            message: "上传成功",
          });
        } else {
          this.$message.error(res.data.msg);
        }
      });
    },
    daochus() {
      window.location.href =
        "http://" +
        window.location.host +
        "/common/statistics_export?token=" +
        sessionStorage.getItem("Token1") +
        "&com_id=" +
        this.com_id +
        "&type_id=" +
        this.type_id +
        "&award_id=" +
        this.award_id +
        "";
    },
    defen(e, index) {
      console.log(e);
      sessionStorage.setItem("Sanme", e.review_name);
      let params = {
        id: e.id,
        token: sessionStorage.getItem("Token1"),
      };
      user_child_details(params).then((res) => {
        console.log(res);
        if (res.data.code == 200) {
          this.obj_id = res.data.data.award_id;
          this.objs = res.data.data;

          // this.objs.accomplish_people = this.objs.accomplish_people;
          // if (this.objs.domain) {
          //   this.objs.domain = this.objs.domain;
          // }
          // if (this.objs.accomplish) {
          //   this.objs.accomplish = this.objs.accomplish;
          // }
          console.log(this.objs);
          this.objs.esid = index.id;
          sessionStorage.setItem("obj", JSON.stringify(this.objs));

          this.centerDialogVisibles = true;
        } else {
          this.$message.error(res.data.msg);
        }
      });
    },
    award_find() {
      award_find().then((res) => {
        let username = sessionStorage.getItem("user_name");
        if (username == "韩羽" || username == "刘辰") {
          this.options1 = res.data.data;
          this.award_id = 2;
        } else if (username == "肖桂华") {
          this.options1 = [
            { id: 4, award_name: "促进奖(单位)" },
            { id: 5, award_name: "促进奖(个人)" },
            { id: 6, award_name: "工匠精神奖" },
          ];
          this.award_id = 4;
        } else if (username == "冯翔慧") {
          this.options1 = [
            { id: 2, award_name: "创新奖(单位)" },
            { id: 3, award_name: "创新奖(个人)" },
          ];
          this.award_id = 2;
        } else if (username == "杨云帆") {
          this.options1 = [{ id: 7, award_name: "创新成果奖" }];
          this.award_id = 7;
        }
        this.user_split_list();
      });
    },
    user_select() {
      user_select().then((res) => {
        this.option = res.data.data;
      });
    },
    typeApi() {
      typeApi().then((res) => {
        console.log(res);
        this.options = res.data.data;
        console.log(this.options);
      });
    },
    user_split_list() {
      let aaa = {
        page: this.page,
        com_id: this.com_id,
        type_id: this.type_id,
        com_name: this.com_name,
        award_id: this.award_id,
        fz_id: this.fz_id,
        token: sessionStorage.getItem("Token1"),
      };
      review_award_list(aaa).then((res) => {
        console.log(res);
        this.tableData = res.data.data.data;
        this.tableData.forEach((item) => {
          console.log(item);
          if (item.is_award == 3) {
            item.is_award = "";
          }
          if (item.is_award_details == 0) {
            item.is_award_details = "";
          }
          if (this.award_id == 7) {
            if (item.is_award == 2) {
              item.is_award_details = 4;
            }
          }
        });
        this.num_page = res.data.data.totalPage;
        this.$forceUpdate();
      });
    },
    fanhui() {
      this.$router.push({ path: "/chuangjian" });
    },
    handleCurrentChange(val) {
      this.page = val;
      this.user_split_list();
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
      console.log(this.multipleSelection);
    },
    fenpei() {
      let arr = [];
      if (this.multipleSelection) {
        this.multipleSelection.forEach((item) => {
          arr.push(item.id);
        });
      }
      let aaa = {
        user_id: arr,
        review_id: localStorage.getItem("ids"),
        token: sessionStorage.getItem("Token1"),
      };
      create_user_review(aaa).then((res) => {
        if (res.data.code == 200) {
          this.$message({
            message: "分配成功",
            type: "success",
          });

          this.user_split_list();
        } else {
          this.$message({
            message: res.data.msg,
          });
        }
      });
    },
  },
};
</script>

<style scoped>
.fenpei {
  width: 100%;
  height: 100%;
  background-color: #fff;
}
.fenpeis {
  box-sizing: border-box;
  padding: 20px;
  display: flex;
  align-items: center;
}
.fenpeis > div {
  margin: 0 10px;
}
.tables {
  width: 90%;
  height: 80%;
  margin: 0 auto;
  overflow: scroll;
}
.fenye {
  display: flex;
  justify-content: center;
  align-items: center;
}
input {
  width: 80px;
}
</style>